home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / man / cat.n / button.n < prev    next >
Text File  |  1995-07-25  |  15KB  |  264 lines

  1.  
  2.  
  3.  
  4.      bbbbuuuuttttttttoooonnnn((((nnnn))))                    TTTTkkkk (((( ))))                     bbbbuuuuttttttttoooonnnn((((nnnn))))
  5.  
  6.  
  7.  
  8.      _________________________________________________________________
  9.  
  10.      NNNNAAAAMMMMEEEE
  11.           button - Create and manipulate button widgets
  12.  
  13.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  14.           bbbbuuuuttttttttoooonnnn _p_a_t_h_N_a_m_e ?_o_p_t_i_o_n_s?
  15.  
  16.      SSSSTTTTAAAANNNNDDDDAAAARRRRDDDD OOOOPPPPTTTTIIIIOOOONNNNSSSS
  17.           aaaaccccttttiiiivvvveeeeBBBBaaaacccckkkkggggrrrroooouuuunnnndddd               bbbbiiiittttmmmmaaaapppp          ffffoooonnnnttttrrrreeeelllliiiieeeeffff     |
  18.           aaaaccccttttiiiivvvveeeeFFFFoooorrrreeeeggggrrrroooouuuunnnndddd               bbbboooorrrrddddeeeerrrrWWWWiiiiddddtttthhhh     ffffoooorrrreeeeggggrrrroooouuuunnnnddddtttteeeexxxxtttt |
  19.           aaaannnncccchhhhoooorrrr          ccccuuuurrrrssssoooorrrr         ppppaaaaddddXXXX            tttteeeexxxxttttVVVVaaaarrrriiiiaaaabbbblllleeee   |
  20.           bbbbaaaacccckkkkggggrrrroooouuuunnnndddd      ddddiiiissssaaaabbbblllleeeeddddFFFFoooorrrreeeeggggrrrroooouuuunnnndddd             ppppaaaaddddYYYY           |
  21.  
  22.           See the ``options'' manual entry for details on the standard
  23.           options.
  24.  
  25.      WWWWIIIIDDDDGGGGEEEETTTT----SSSSPPPPEEEECCCCIIIIFFFFIIIICCCC OOOOPPPPTTTTIIIIOOOONNNNSSSS
  26.           Name:           ccccoooommmmmmmmaaaannnndddd
  27.           Class:          CCCCoooommmmmmmmaaaannnndddd
  28.           Command-Line Switch:----ccccoooommmmmmmmaaaannnndddd
  29.  
  30.                Specifies a Tcl command to associate with  the  button.
  31.                This  command  is typically invoked when mouse button 1
  32.                is released over the button window.
  33.  
  34.           Name:           hhhheeeeiiiigggghhhhtttt                                        |
  35.           Class:          HHHHeeeeiiiigggghhhhtttt                                        |
  36.           Command-Line Switch:----hhhheeeeiiiigggghhhhtttt                                   |
  37.  
  38.                                                                              ||
  39.                Specifies a desired height for the button.  If a bitmap  |
  40.                is being displayed in the button then the value  is  in  |
  41.                screen  units  (i.e.  any  of  the  forms acceptable to  |
  42.                TTTTkkkk____GGGGeeeettttPPPPiiiixxxxeeeellllssss); for text it is in  lines  of  text.   If  |
  43.                this  option  isn't  specified,  the  button's  desired  |
  44.                height is computed from the size of the bitmap or  text  |
  45.                being displayed in it.                                   |
  46.  
  47.           Name:           ssssttttaaaatttteeee                                         |
  48.           Class:          SSSSttttaaaatttteeee                                         |
  49.           Command-Line Switch:----ssssttttaaaatttteeee                                    |
  50.  
  51.                                                                              ||
  52.                Specifies  one of three states for the button:  nnnnoooorrrrmmmmaaaallll,  |
  53.                aaaaccccttttiiiivvvveeee, or ddddiiiissssaaaabbbblllleeeedddd.  In normal  state  the  button  is  |
  54.                displayed  using the ffffoooorrrreeeeggggrrrroooouuuunnnndddd and bbbbaaaacccckkkkggggrrrroooouuuunnnndddd options.  |
  55.                The active state is typically used when the pointer  is  |
  56.                over  the  button.   In  active  state  the  button  is  |
  57.                displayed    using     the     aaaaccccttttiiiivvvveeeeFFFFoooorrrreeeeggggrrrroooouuuunnnndddd     and  |
  58.                aaaaccccttttiiiivvvveeeeBBBBaaaacccckkkkggggrrrroooouuuunnnndddd  options.   Disabled  state means that  |
  59.                the button is insensitive:   it  doesn't  activate  and  |
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 7/23/95)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      bbbbuuuuttttttttoooonnnn((((nnnn))))                    TTTTkkkk (((( ))))                     bbbbuuuuttttttttoooonnnn((((nnnn))))
  71.  
  72.  
  73.  
  74.                doesn't respond to mouse button presses.  In this state  |
  75.                the ddddiiiissssaaaabbbblllleeeeddddFFFFoooorrrreeeeggggrrrroooouuuunnnndddd and bbbbaaaacccckkkkggggrrrroooouuuunnnndddd options determine  |
  76.                how the button is displayed.                             |
  77.  
  78.           Name:           wwwwiiiiddddtttthhhh                                         |
  79.           Class:          WWWWiiiiddddtttthhhh                                         |
  80.           Command-Line Switch:----wwwwiiiiddddtttthhhh                                    |
  81.  
  82.                                                                              ||
  83.                Specifies  a desired width for the button.  If a bitmap  |
  84.                is being displayed in the button then the value  is  in  |
  85.                screen  units  (i.e.  any  of  the  forms acceptable to  |
  86.                TTTTkkkk____GGGGeeeettttPPPPiiiixxxxeeeellllssss); for text it is in characters.   If  this  |
  87.                option  isn't  specified, the button's desired width is  |
  88.                computed from the size of  the  bitmap  or  text  being  |
  89.                displayed in it.
  90.      _________________________________________________________________
  91.  
  92.  
  93.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  94.           The bbbbuuuuttttttttoooonnnn command  creates  a  new  window  (given  by  the
  95.           _p_a_t_h_N_a_m_e  argument)  and  makes  it  into  a  button widget.
  96.           Additional options, described above, may be specified on the
  97.           command  line or in the option database to configure aspects
  98.           of the button such as its colors, font,  text,  and  initial
  99.           relief.   The  bbbbuuuuttttttttoooonnnn command returns its _p_a_t_h_N_a_m_e argument.
  100.           At the time this command is invoked, there must not exist  a
  101.           window named _p_a_t_h_N_a_m_e, but _p_a_t_h_N_a_m_e's parent must exist.
  102.  
  103.           A button is a widget  that  displays  a  textual  string  or  |
  104.           bitmap.   It can display itself in either of three different  |
  105.           ways, according to the ssssttttaaaatttteeee  option;  it  can  be  made  to
  106.           appear raised, sunken, or flat; and it can be made to flash.
  107.           When a user invokes the button (by pressing mouse  button  1
  108.           with  the  cursor  over  the  button),  then the Tcl command
  109.           specified in the ----ccccoooommmmmmmmaaaannnndddd option is invoked.
  110.  
  111.  
  112.      WWWWIIIIDDDDGGGGEEEETTTT CCCCOOOOMMMMMMMMAAAANNNNDDDD
  113.           The bbbbuuuuttttttttoooonnnn command creates a new Tcl command whose  name  is
  114.           _p_a_t_h_N_a_m_e.   This  command  may  be  used  to  invoke various
  115.           operations on the widget.   It  has  the  following  general
  116.           form:
  117.  
  118.                _p_a_t_h_N_a_m_e _o_p_t_i_o_n ?_a_r_g _a_r_g ...?
  119.           _O_p_t_i_o_n and the _a_r_gs determine  the  exact  behavior  of  the
  120.           command.   The  following  commands  are possible for button
  121.           widgets:
  122.  
  123.           _p_a_t_h_N_a_m_e aaaaccccttttiiiivvvvaaaatttteeee
  124.                Change the button's state to aaaaccccttttiiiivvvveeee and  redisplay  the
  125.                button  using  its  active  foreground  and  background
  126.  
  127.  
  128.      Page 2                                          (printed 7/23/95)
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.      bbbbuuuuttttttttoooonnnn((((nnnn))))                    TTTTkkkk (((( ))))                     bbbbuuuuttttttttoooonnnn((((nnnn))))
  136.  
  137.  
  138.  
  139.                colors instead  of  normal  colors.   This  command  is  |
  140.                ignored  if  the  button's  state  is  ddddiiiissssaaaabbbblllleeeedddd.   This  |
  141.                command is obsolete and will eventually be removed; use  |
  142.                ``_p_a_t_h_N_a_m_e ccccoooonnnnffffiiiigggguuuurrrreeee ----ssssttttaaaatttteeee aaaaccccttttiiiivvvveeee'' instead.
  143.  
  144.           _p_a_t_h_N_a_m_e ccccoooonnnnffffiiiigggguuuurrrreeee ?_o_p_t_i_o_n? ?_v_a_l_u_e _o_p_t_i_o_n _v_a_l_u_e ...?
  145.                Query  or  modify  the  configuration  options  of  the
  146.                widget.   If  no  _o_p_t_i_o_n  is  specified, returns a list
  147.                describing all of the available  options  for  _p_a_t_h_N_a_m_e
  148.                (see  TTTTkkkk____CCCCoooonnnnffffiiiigggguuuurrrreeeeIIIInnnnffffoooo for information on the format of
  149.                this list).  If _o_p_t_i_o_n is specified with no _v_a_l_u_e, then
  150.                the  command  returns  a  list describing the one named
  151.                option  (this   list   will   be   identical   to   the
  152.                corresponding  sublist  of  the  value  returned  if no
  153.                _o_p_t_i_o_n is specified).   If  one  or  more  _o_p_t_i_o_n-_v_a_l_u_e
  154.                pairs  are  specified,  then  the  command modifies the
  155.                given widget option(s) to have the given value(s);   in
  156.                this  case the command returns an empty string.  _O_p_t_i_o_n
  157.                may have any of  the  values  accepted  by  the  bbbbuuuuttttttttoooonnnn
  158.                command.
  159.  
  160.           _p_a_t_h_N_a_m_e ddddeeeeaaaaccccttttiiiivvvvaaaatttteeee
  161.                Change the button's state to nnnnoooorrrrmmmmaaaallll and  redisplay  the
  162.                button  using  its  normal  foreground  and  background
  163.                colors.  This command is ignored if the button's  state  |
  164.                is   ddddiiiissssaaaabbbblllleeeedddd.   This  command  is  obsolete  and  will  |
  165.                eventually be removed; use ``_p_a_t_h_N_a_m_e ccccoooonnnnffffiiiigggguuuurrrreeee  ----ssssttttaaaatttteeee  |
  166.                nnnnoooorrrrmmmmaaaallll'' instead.
  167.  
  168.           _p_a_t_h_N_a_m_e ffffllllaaaasssshhhh
  169.                Flash the button.  This is accomplished by redisplaying
  170.                the  button  several  times, alternating between active
  171.                and normal colors.  At the end of the flash the  button
  172.                is  left  in  the  same normal/active state as when the
  173.                command was invoked.  This command is  ignored  if  the  |
  174.                button's state is ddddiiiissssaaaabbbblllleeeedddd.
  175.  
  176.           _p_a_t_h_N_a_m_e iiiinnnnvvvvooookkkkeeee
  177.                Invoke the Tcl command associated with the  button,  if  |
  178.                there  is  one.   The  return value is the return value  |
  179.                from the Tcl command, or an empty string if there is no  |
  180.                command  associated  with  the button.  This command is  |
  181.                ignored if the button's state is ddddiiiissssaaaabbbblllleeeedddd.
  182.  
  183.  
  184.      DDDDEEEEFFFFAAAAUUUULLLLTTTT BBBBIIIINNNNDDDDIIIINNNNGGGGSSSS
  185.           Tk automatically creates class  bindings  for  buttons  that  |
  186.           give them the following default behavior:                     |
  187.  
  188.           [1]                                                                ||
  189.                The  button activates whenever the mouse passes over it  |
  190.                and deactivates whenever the mouse leaves the button.    |
  191.  
  192.  
  193.  
  194.      Page 3                                          (printed 7/23/95)
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.      bbbbuuuuttttttttoooonnnn((((nnnn))))                    TTTTkkkk (((( ))))                     bbbbuuuuttttttttoooonnnn((((nnnn))))
  202.  
  203.  
  204.  
  205.           [2]                                                                ||
  206.                The button's relief is changed to sunken whenever mouse  |
  207.                button 1 is pressed over the button, and the relief  is  |
  208.                restored  to  its original value when button 1 is later  |
  209.                released.                                                |
  210.  
  211.           [3]                                                                ||
  212.                If  mouse button 1 is pressed over the button and later  |
  213.                released  over  the  button,  the  button  is  invoked.  |
  214.                However,  if  the  mouse  is  not  over the button when  |
  215.                button 1 is released, then no invocation occurs.         |
  216.  
  217.           If the button's state is ddddiiiissssaaaabbbblllleeeedddd then  none  of  the  above  |
  218.           actions occur:  the button is completely non-responsive.      |
  219.  
  220.           The behavior of buttons  can  be  changed  by  defining  new  |
  221.           bindings  for  individual widgets or by redefining the class  |
  222.           bindings.
  223.  
  224.  
  225.      KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  226.           button, widget
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.      Page 4                                          (printed 7/23/95)
  261.  
  262.  
  263.  
  264.